package cn.amaake.magicplugin.nacos.enums;

import com.alibaba.nacos.api.utils.StringUtils;
import java.util.HashMap;
import java.util.Map;

public enum ConfigType {
    PROPERTIES("properties"),
    XML("xml"),
    JSON("json"),
    TEXT("text"),
    HTML("html"),
    YAML("yaml"),
    TOML("toml"),
    UNSET("unset");

    private final String type;
    private static final Map<String,ConfigType> LOCAL_MAP = new HashMap();

    private ConfigType(String type) {
        this.type = type;
    }

    public String getType() {
        return this.type;
    }

    public static ConfigType getDefaultType() {
        return TEXT;
    }

    public static Boolean isValidType(String type) {
        return StringUtils.isBlank(type) ? false : null != LOCAL_MAP.get(type);
    }

    static {
        ConfigType[] var0 = values();
        int var1 = var0.length;

        for(int var2 = 0; var2 < var1; ++var2) {
            ConfigType configType = var0[var2];
            LOCAL_MAP.put(configType.getType(), configType);
        }

    }
}
